package com.wing.purchase.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wing.purchase.model.entity.PurchasePlanDetail;
import com.wing.purchase.model.response.PurchasePlanCheckVO;
import com.wing.purchase.model.response.PurchasePlanDetailVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 领料计划明细-Dao
 *
 * @author
 */
@Mapper
public interface PurchasePlanDetailDao extends BaseMapper<PurchasePlanDetail> {

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<PurchasePlanDetailVO> list4app(@Param("params") Map<String, Object> params);

    /**
     * 分页列表-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    List<PurchasePlanDetailVO> list4app(@Param("page") Page<PurchasePlanDetailVO> page, @Param("params") Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    PurchasePlanDetailVO get4appById(Long id);

    /**
     * 改变采购计划核对状态
     * @param newStatus
     * @param oldStatus
     * @param planNo
     * @param purchaseUrgencyId
     * @return
     */
    int changePlanCheckStatus(@Param("newStatus") Integer newStatus, @Param("oldStatus") Integer oldStatus
            , @Param("planNo") String planNo, @Param("purchaseUrgencyId") Long purchaseUrgencyId);

    /**
     * 获取领料计划明细
     * @param params
     * @return
     */
    List<PurchasePlanCheckVO> findCheckInfoList(@Param("params") Map<String, Object> params);
}
